package com.kfm.base.loop;

public class Demo {

    public static void main(String[] args) {
        /*
           输入所有的水仙花数
         */

        // 输出 100 ~ 999
        for (int num = 100;
             num < 1000;
             num ++){

            int b = num / 100;
            int s = num / 10 % 10;
            int g = num % 10;

            if (b * b * b + s * s * s + g * g * g == num){
                System.out.println(num + " 是水仙花数");
            }

        }
    }
}
